NetCacheBack is a droplet AppleScript application, which analyses the Cache folder of Netscape Navigator and gives the real name and location to each cache file.
I love AppleScript. Let me try to talk about the NetCacheBack briefly in AppleScript-like language. :-) Now, tell application "NetCacheBack" to move the cache files (* say "cache123000" *) in the cache folder of the application "Netscape Navigator" into the folder URL from the file "Cache log", and then rename it with the proper name of the URL (* say "home/index.html" *).
NetCacheBack is written as an AppleScript document, so it requires System 7.5 or later. Or, you need the relative version of scriptable Finder and other Scripting Additions.
*** IMPORTANT ***
For the Netscape Navigator 2.0╒s users, please notice that my reverse-engineering on cache log database is not a perfect work. Maybe or not, I wonder the format of database will be changed in the future versions of beta or final release of 2.0╒s. Even if so, I am catching up with the new frontier as possible. Please keep up on the future release of my helper program NetCacheResolver for the new coming cache log databases.
*** CONTENTS ***
-----------------
Ñ How to install NetCacheBack programs?
Ñ The Cache folder of Netscape Navigator is a treasury of WWW
Ñ How NetCacheBack works?
Ñ How to run NetCacheBack?
Ñ About Preferences of NetCacheBack
Ñ Tips about running NetCacheBack
Ñ Known problems, and some wishes
Ñ Changes since 0.9dx
Ñ Files included in the package
Ñ About the helper program NetCacheResolver
Ñ Comments, or Bug reports
Ñ My WWW software catalog page is located at
-----------------
Ñ How to install NetCacheBack programs?
A regular system configuration of NetCacheBack is depicted as follows;
myFolder:
|-- NetCacheBack
|-- NetCacheResolver
Macintosh HD:System Folder:Preferences:
|-- NetCacheBack Prefs
Please put (or copy) the "NetCacheBack Prefs" file to Preferences folder of your System Folder, though NetCacheBack can operate properly without this preferences file. If no "NetCacheBack Prefs" file is not found in Preferences folder, then NetCacheBack will use its default settings, which instead may ignore the content-type changes. Please see the section ╥About Preferences...╙ for more details.
Ñ The Cache folder of Netscape Navigator is a treasury of WWW
During your netsurf on the Netscape Navigator, any HTML documents or image data you have read are stored temporarily in the Cache folder. Whereas the files are cached like below;
For 1.1N:
Cache log --- a database of cache files and actual URLs
cache123000-2 --- a HTML document or image data file
For 2.0╒s:
CCache log --- a database of cache files and actual URLs
cache123000.html --- a HTML document or image data file
So, you can not find it out easily what they are.
Ñ How NetCacheBack works?
For the 1.1N, suppose that a relation of files is described in the file Cache log;
When you drag and drop the cache file "cache123000-2" onto NetCacheBack icon, the file is renamed to "index.html" and then moved to the destination folder. If the folders do not exist, any new folders required are created automatically. Let me show the process as follows;
Beginning with the home page "index.html", you can netsurf to any documents that are hyper-linked to other HTML files or image data.
For the 2.0╒s, NetCacheBack first tries to get a Cache log data from the CCache log of 2.0╒s with the help of NetCacheResolver. Otherwise you can make a new Cache log file by your hand to drag and drop the CCache log file onto the NetCacheResolver icon. If the Cache log file does exist and the modification date of Cache log is older than that date of CCache log, then this conversion will be proceeded automatically to renew the Cache log database. Once the Cache log file is created by your hand, NetCacheBack is not willing to discard the Cache log file even after the operation has finished.
Ñ How to run NetCacheBack?
Just drag and drop cache files like "cache123000-2" (or "cache123000.html") in the Cache folder onto NetCacheBack icon. That╒s all what to do. You can move the Cache folder anywhere. But, the file "Cache log" (or "CCache log") must be located in the same folder where the cache files are.
The attributes of the cache files are changed according to their document types. For instance, any HTML documents are changed to those of Netscape Navigator, and image files of GIF and JPEG are to those of JPEGView. You can add a new types to or delete them from the attribute list, that is placed in "NetCacheBack Prefs" file.
Ñ About Preferences of NetCacheBack
There are two categories in the preference file "NetCacheBack Prefs", ERROR-HANDLING and CONTENT-TYPE. Unlike most preferences files of Macintosh programs, this file is a simple TEXT file, so you can modify it easily by some regular text editors. I am afraid that sounds awfully dull like as UNIX's *.rc or Windoze's WIN.INI setting files, sorry ;-) In the file you can find a brief comment how to write or modify this preferences file.
[ERROR-HANDLING]
Ñ TRACELOG (default:=yes)
When this option is set to ╘yes╒, NetCacheBack traces error handlings and write down its error status to "NetCacheBack log" file, that is placed at the Cache folder.
Ñ VERBOSE (default:=yes)
When this option is set to ╘no╒, no error message dialog will appear even if some error occurs, like ╥Cant╒t move file A to B╙. This option makes a good sense of avoiding AppleEvent time-out error after waiting for ╥OK╙ button a while.
Ñ OVERRIDE (default:=no)
The option is a nice escape from the interruption caused by some file handling errors, such as by very-long file name or duplicate file name. When it is set to ╘no╒, NetCacheBack tries to convert cache files to any appropriate ones, by truncating file name string or replacing old files. Be sure when TRACELOG option is set to ╘yes╒, this exceptional process is logged to "NetCacheBack log" file.
[CONTENT-TYPE]
You can add your own content-types to, or delete them from the list, whose default settings are as follows;
As to searching the database, it is a good idea to arrange the records in alphabetical or numerical order, such as sorted by ╥Name╙, ╥Size╙, ╥Modification Date╙, and others. According to the viewing method of the Finder╒s window, NetCacheBack tries to get the cache log database constructed in the corresponding order with the help of NetCacheResolver. Once disposed in the same order, the first item among the given cache files must come at the top position in the cache log database. The first comes first always, but not never last. In addition, after doing with the query, NetCacheBack removes the each record from the internal database to reduce the scale. Now, let me tell you what to do. You shall try to ╥Select All╙ cache files in the cache folder and drop them onto the NetCacheBack icon. Even how large the scale of database is, NetCacheBack will accomplish each query within 2 to 5 seconds.
Ñ Known problems, and some wishes
(1) It runs veeeeeery slowly. If the file size of Cache log (or "CCache log") is bigger, it runs much slower. Typically it takes about 5 seconds for each operation if the Cache folder contains about 100 files! Huum, there must be some room to optimize, I╒m afraid. ;-)
(2) When the many (how ╥many╙?, maybe 100 or so) cache files are selected for the droplet application, NetCacheBack may accidentally abort the operation by failures on manipulating the filename strings. Please try again with one file, then it will work well.
Othewise, please increase the application memory size from the ╥Get Info╙ dialog. Currently, it is set to ╥600KB╙, which I think is adequate to everyone╒s use, that is the case of Cache folder size is 5 MB and 500 cache files in it.
(3) It is best for any HTML documents, whose HREF markup tags are written in a ╥relative pathname╙ style. If they are in ╥full pathname╙, it is you who must pick up the parts and correct them. Some one says it is also the work for AppleScript, but isn╒t it too hard? I am not sure, sorry. But I strongly believe that there is nothing impossible in the Web world. ;-) Even if it can be done, please be noticed not to violate the copyright issues.
Ñ Changes since 0.9d5, October 26, 1995
(1) Yesterday (oh, what is today?:-), I encountered an Unidentified Field Object in the CCache log database. This latent field, which I called ╥export╙, was an unexpected one, though I think most users may not have suffered from it. NetCacheResolver failed to resolve it properly. I fixed it.
(2) Using preferences file "NetCacheBack Prefs", from which NetCacheBack reads the operating conditions. For more information, please see the ╥About Preferences...╙ section.
(3) Now, you can choose the optional settings for error handlings, from TRACELOG, VERBOSE, and OVERRIDE conditions. Under the default settings, NetCacheBack will not stop its operation to display the error message dialog, instead will write down its error status to "NetCacheBack log" file. See also the section ╥About Preferences...╙.
(4) When two cache log databases Cache log and CCache log are residing in the same Cache folder, NetCacheBack sometimes failed to open the Cache log file. This error might be caused by a bug of Apple Script Editor 1.1.1, that should miss the global variable assignment. I fixed it by writing some extra AppleScript codes.
Ñ Changes since 0.9d4, October 22, 1995
Some rare case happens that cache file records are come up against an exceptional field named ╥content-type╙. Have you ever in the Web world met with them? NetCacheResolver failed to resolve it properly. I fixed it.
Ñ Changes since 0.9d3, October 15, 1995
NetCacheResolver returns the cache log records, sorted in the right order by Name, Date, Size, and others. Due to this sorting, NetCacheBack search method becomes much easier and more radid for querying the database. Typically it runs over 2 to 20 times faster than the previous version. Or, the operating time for each query is kept constant, independent of the database size. This effect is good at both with Netscape Navigator 1.1N and 2.0╒s. For more information, please read the ╥Tips about running...╙ section of this readme document.
Ñ Changes since 0.9d2, June 13, 1995
Now NetCacheBack works well for both versions of 1.1N and 2.0╒s of Netscape Navigator. Among these versions, there comes about some changes in the record format of the cache log databases. If you are using the 2.0╒s version, then NetCacheBack first tries to convert the 2.0╒s cache log database to the new one in 1.1N format with a helper program NetCacheResolver.
Ñ Files included are ...
1. NetCacheBack -- a droplet AppleScript application
2. NetCacheBack Prefs -- please put this file to Preferences folder of your system
3. NetCacheBack source -- a source code written in AppleScript
4. NetCacheBack readme -- just this file you are reading
5. NetCacheResolver -- an AppleScriptable helper application
6. NetCacheResolver readme
This is a freeware program. You can distribute it without any limitations nor permission.
Ñ About the helper program NetCacheResolver ...
NetCacheResolver is a helper program that converts the 2.0╒s CCache log datatabe to 1.1N╒s Cache log one. It is an AppleScriptable application, such as responding and directly sending back the resolved records to NetCacheBack. The source code is also published, written with the Metrowerks CodeWarrior. For its source code, you can find it at the development source code directory of the ╥info-mac╙ archive sites, where I posted it separately. Also you can find them at my WWW software catalog page described below.